// pages/index/welfare/welfare.js
Page({

  /**
   * Page initial data
   */
  data: {
    res:[]
  },

  /**
   * Lifecycle function--Called when page load
   */
  onLoad(options) {
    wx.request({
      url: 'http://localhost:8080/publicWelfare/getAll?pageNum=1&pageSize=10',
      success:res => {
        console.log(res);
        console.log(res.data.data.list);
        this.setData({
          res:res.data.data.list
        })
      }
    })
  },


  transfer(e){
    wx.navigateTo({
      url: `/pages/index/welfare/welfaredetail/WelfareDetail?id=${e.currentTarget.dataset.id}`,
    })
  },

  /**
   * Lifecycle function--Called when page is initially rendered
   */
  onReady() {

  },

  /**
   * Lifecycle function--Called when page show
   */
  onShow() {

  },

  /**
   * Lifecycle function--Called when page hide
   */
  onHide() {

  },

  /**
   * Lifecycle function--Called when page unload
   */
  onUnload() {

  },

  /**
   * Page event handler function--Called when user drop down
   */
  onPullDownRefresh() {

  },

  /**
   * Called when page reach bottom
   */
  onReachBottom() {

  },

  /**
   * Called when user click on the top right corner to share
   */
  onShareAppMessage() {

  }
})